home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / ctime.man < prev    next >
Encoding:
Text File  |  1991-02-04  |  6.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. CTIME                 C Library Procedures                  CTIME
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      ctime, localtime, mktime, gmtime, asctime, timezone, tzset -
  10.      convert date and time to ASCII
  11.  
  12. SSYYNNOOPPSSIISS
  13.      vvooiidd ttzzsseett(())
  14.  
  15.      cchhaarr **ccttiimmee((cclloocckk))
  16.      ttiimmee__tt **cclloocckk;;
  17.  
  18.      ##iinncclluuddee <<ttiimmee..hh>>
  19.  
  20.      cchhaarr **aassccttiimmee((ttmm))
  21.      ssttrruucctt ttmm **ttmm;;
  22.  
  23.      ssttrruucctt ttmm **llooccaallttiimmee((cclloocckk))
  24.      ttiimmee__tt **cclloocckk;;
  25.  
  26.      ttiimmee__tt mmkkttiimmee((ttmm))
  27.      ssttrruucctt ttmm **ttmm;;
  28.  
  29.      ssttrruucctt ttmm **ggmmttiimmee((cclloocckk))
  30.      ttiimmee__tt **cclloocckk;;
  31.  
  32.      cchhaarr **ttiimmeezzoonnee((zzoonnee,, ddsstt))
  33.  
  34. DDEESSCCRRIIPPTTIIOONN
  35.      _T_z_s_e_t uses the value of the environment variable TTZZ to set
  36.      up the time conversion information used by _l_o_c_a_l_t_i_m_e.
  37.  
  38.      If TTZZ does not appear in the environment, the TTZZDDEEFFAAUULLTT file
  39.      (as defined in _t_z_f_i_l_e._h) is used by _l_o_c_a_l_t_i_m_e.  If this file
  40.      fails for any reason, the GMT offset as provided by the ker-
  41.      nel is used.  In this case, DST is ignored, resulting in the
  42.      time being incorrect by some amount if DST is currently in
  43.      effect.  If this fails for any reason, GMT is used.
  44.  
  45.      If TTZZ appears in the environment but its value is a null
  46.      string, Greenwich Mean Time is used; if TTZZ appears and
  47.      begins with a slash, it is used as the absolute pathname of
  48.      the _t_z_f_i_l_e(5)-format file from which to read the time
  49.      conversion information; if TTZZ appears and begins with a
  50.      character other than a slash, it's used as a pathname rela-
  51.      tive to the system time conversion information directory,
  52.      defined as TTZZDDIIRR in the include file _t_z_f_i_l_e._h.  If this file
  53.      fails for any reason, the GMT offset as provided by the ker-
  54.      nel is used, as described above.  If this fails for any rea-
  55.      son, GMT is used.
  56.  
  57.      Programs that always wish to use local wall clock time
  58.      should explicitly remove the environmental variable TTZZ with
  59.      _u_n_s_e_t_e_n_v(3).
  60.  
  61.  
  62.  
  63. Sprite v1.0         28 January 1991 (Sprite)                    1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. CTIME                 C Library Procedures                  CTIME
  71.  
  72.  
  73.  
  74.      _C_t_i_m_e converts a long integer, pointed to by _c_l_o_c_k, such as
  75.      returned by _t_i_m_e(3), into ASCII and returns a pointer to a
  76.      26-character string in the following form.  All the fields
  77.      have constant width.
  78.  
  79.          Sun Sep 16 01:03:52 1973\n\0
  80.  
  81.      _L_o_c_a_l_t_i_m_e and _g_m_t_i_m_e return pointers to structures contain-
  82.      ing the broken-down time.  _L_o_c_a_l_t_i_m_e corrects for the time
  83.      zone and possible daylight savings time; _g_m_t_i_m_e converts
  84.      directly to GMT, which is the time UNIX uses.  _M_k_t_i_m_e per-
  85.      forms the inverse of _l_o_c_a_l_t_i_m_e, using the year, month, day-
  86.      of-month, hour, minute, and second to get the number of
  87.      seconds since the start of the Epoch.  _A_s_c_t_i_m_e converts a
  88.      broken-down time to ASCII and returns a pointer to a 26-
  89.      character string.
  90.  
  91.      The structure declaration from the include file is:
  92.  
  93.           struct tm {
  94.                int tm_sec;    /* 0-59  seconds */
  95.                int tm_min;    /* 0-59  minutes */
  96.                int tm_hour;   /* 0-23  hour */
  97.                int tm_mday;   /* 1-31  day of month */
  98.                int tm_mon;    /* 0-11  month */
  99.                int tm_year;   /* 0-    year - 1900 */
  100.                int tm_wday;   /* 0-6   day of week (Sunday = 0) */
  101.                int tm_yday;   /* 0-365 day of year */
  102.                int tm_isdst;  /* flag: daylight savings time in effect */
  103.                char **tm_zone;         /* abbreviation of timezone name */
  104.                long tm_gmtoff;         /* offset from GMT in seconds */
  105.           };
  106.  
  107.      _T_m__i_s_d_s_t is non-zero if a time zone adjustment such as Day-
  108.      light Savings time is in effect.
  109.  
  110.      _T_m__g_m_t_o_f_f is the offset (in seconds) of the time represented
  111.      from GMT, with positive values indicating East of Greenwich.
  112.  
  113.      _T_i_m_e_z_o_n_e remains for compatibility reasons only; it's impos-
  114.      sible to reliably map timezone's arguments (_z_o_n_e, a "minutes
  115.      west of GMT" value and _d_s_t, a "daylight saving time in
  116.      effect" flag) to a time zone abbreviation.
  117.  
  118.      If the environmental string _T_Z_N_A_M_E exists, _t_i_m_e_z_o_n_e returns
  119.      its value, unless it consists of two comma separated
  120.      strings, in which case the second string is returned if _d_s_t
  121.      is non-zero, else the first string.  If _T_Z_N_A_M_E doesn't
  122.      exist, _z_o_n_e is checked for equality with a built-in table of
  123.      values, in which case _t_i_m_e_z_o_n_e returns the time zone or day-
  124.      light time zone abbreviation associated with that value.  If
  125.      the requested _z_o_n_e does not appear in the table, the
  126.  
  127.  
  128.  
  129. Sprite v1.0         28 January 1991 (Sprite)                    2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. CTIME                 C Library Procedures                  CTIME
  137.  
  138.  
  139.  
  140.      difference from GMT is returned; e.g. in Afghanistan,
  141.      _t_i_m_e_z_o_n_e(-(_6_0*_4+_3_0), _0) is appropriate because it is 4:30
  142.      ahead of GMT, and the string GGMMTT++44::3300 is returned.  Programs
  143.      that in the past used the _t_i_m_e_z_o_n_e function should return
  144.      the zone name as set by _l_o_c_a_l_t_i_m_e to assure correctness.
  145.  
  146. FFIILLEESS
  147.      /etc/zoneinfo            time zone information directory
  148.      /etc/zoneinfo/localtime  local time zone file
  149.  
  150. SSEEEE AALLSSOO
  151.      gettimeofday(2), getenv(3), time(3), tzfile(5), environ(7)
  152.  
  153. NNOOTTEESS
  154.      The return values point to static data whose content is
  155.      overwritten by each call.  This static area is also
  156.      overwritten by calls to _m_k_t_i_m_e.  The ttmm__zzoonnee field of a
  157.      returned ssttrruucctt ttmm points to a static array of characters,
  158.      which will also be overwritten at the next call (and by
  159.      calls to _t_z_s_e_t).
  160.  
  161.      This definition of _m_k_t_i_m_e is simpler than and slightly
  162.      incompatible with the BSD version.
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0         28 January 1991 (Sprite)                    3
  196.  
  197.  
  198.  
  199.